package com.demo.download.controller;

import com.demo.download.config.RestTemplateBuilder;
import com.demo.download.server.impl.ByteArrayResponseExtractor;
import org.springframework.http.HttpMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class DownController {

    @RequestMapping("/download")
    public void download(){
        RestTemplateBuilder builder = new RestTemplateBuilder();
        RestTemplate restTemplate = builder.build();
        byte[] data = restTemplate.execute("", HttpMethod.GET,null,new ByteArrayResponseExtractor());
    }

}
